<?php
	if(isset($_POST['phoneNumber'])) {
		
		require_once '../includes/Config.inc.php';
		$cfg = Config::getInstance('..');
		/*
		$myUid = $cfg->getFacebook()->require_login();
		$user = User::getUserFbID($myUid);
		*/
		$user = User::getUserFbID($_POST['userId']);
		
		$orange = new OrangeAPI($cfg->or_api_key);
		$resp = $orange->clickToCall($_POST['phoneNumber'], $user->phone);
		
		echo "Status: ".$resp->getStatusMsg();
	}
	
?>
